package cn.bearspark.user.provider.rpc;

import cn.bearspark.common.dto.ResponseDTO;
import cn.bearspark.user.dto.LoginRespDTO;
import cn.bearspark.user.dto.UserBaseInfoDTO;
import cn.bearspark.user.dto.UserSimpleDTO;
import cn.bearspark.user.dto.UserSlimDTO;
import cn.bearspark.user.provider.service.UserBaseService;
import cn.bearspark.user.rpc.UserBaseRpc;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author f
 */
@Component
@DubboService
public class UserBaseRpcImpl implements UserBaseRpc {

    private final UserBaseService userBaseService;

    public UserBaseRpcImpl(UserBaseService userBaseService) {
        this.userBaseService = userBaseService;
    }

    @Override
    public ResponseDTO<Object> initPassword(String phone, String password) {
        return userBaseService.initPassword(phone, password);
    }

    @Override
    public ResponseDTO<Object> modifyPassword(String phone, String password) {
        return userBaseService.modifyPassword(phone, password);
    }

    @Override
    public ResponseDTO<LoginRespDTO> login(String phone, String password) {
        return userBaseService.login(phone, password);
    }

    @Override
    public UserBaseInfoDTO getBaseInfo(long id) {
        return userBaseService.getBaseInfo(id);
    }

    @Override
    public List<UserSimpleDTO> listFSimpleInfo(long userId) {
        return userBaseService.listFSimpleInfo(userId);
    }

    @Override
    public List<UserSlimDTO> listFSlimInfo(long userId) {
        return userBaseService.listFSlimInfo(userId);
    }

    @Override
    public List<UserSlimDTO> listFSlimInfoWithHappening(long userId) {
        return userBaseService.listFSlimInfoWithHappening(userId);
    }

    @Override
    public UserSlimDTO getSlimInfo(long userId) {
        return userBaseService.getSlimInfo(userId);
    }

    @Override
    public Map<Long, UserSlimDTO> mapSlimInfo(Set<Long> userIdSet) {
        return userBaseService.mapSlimInfo(userIdSet);
    }

    @Override
    public Map<Long, UserSlimDTO> mapSAFSlimInfoWithHappening(long userId) {
        return userBaseService.mapSAFSlimInfoWithHappening(userId);
    }

    @Override
    public List<Long> listFansId(long userId) {
        return userBaseService.listFansId(userId);
    }

    @Override
    public long getHappeningNumByUserId(long userId) {
        return userBaseService.getHappeningNumByUserId(userId);
    }

    @Override
    public Map<Long, String> mapUsername(Set<Long> userIdSet) {
        return userBaseService.mapUsername(userIdSet);
    }

}
